<template>
<div>
  <van-nav-bar
      title="收藏"
      left-arrow
      @click-left="onClickLeft"
  />
  <van-row type="flex" style="overflow: hidden;margin-top:10px" justify="space-between" v-for="(item,index) in CollectionObj.list" :key="index">
    <van-col span="21">
      <!-- 商品列表 -->
      <van-card
          @click="setShopId(item,item.goods_id)"
          :num="item.goods_number"
          :price="item.goods_price"
          desc="软件测试数据！"
          :title="item.goods_name"
          :thumb="item.goods_big_logo==''?'http://image2.suning.cn/uimg/b2c/newcatentries/0070078057-000000000634917020_1_800x800.jpg':item.goods_big_logo"
      />
    </van-col>
    <van-col span="3" >
      <div @click="removeShop(index)" class="reovm">删除</div>
    </van-col>
  </van-row>
  </div>
</template>

<script>
export default {
  name: "Collection",
  methods:{
    removeShop(index){
      this.$store.commit('detail/reovemShop',index)
    },
    onClickLeft(){
      this.$router.back()
    },
    setShopId(item,id){
      this.$router.push({
        path:`/details/${id}`,
      })
    },
  },
  computed:{
    CollectionObj(){
      return this.$store.getters["detail/getCollection"]
    }
  }
}
</script>

<style scoped lang="less">
.reovm{height:100%;background: red;text-align: center;color: #fafafa;line-height: 88px}
</style>